<?php


class LessonController extends Controller
{
  /**
   * 课程列表
   * @param string $keywords
   */
  public function actionList($keywords = '')
  {
    $lesson = LessonService::instance()->getList(10, true, false, 0, $keywords);
    $this->render('/site/lesson/list', array(
        'lesson' => $lesson
    ));
  }

  /**
   * 课程文章列表
   * @param int $id
   * @param string $keywords
   */
  public function actionView($id = 0, $keywords = '')
  {
    $this->checkLesson($id,0,true,false);
    $article = ArticleService::instance()->getList(10, $id, true, $keywords);
    $lesson = Lesson::model()->findByPk($id);
    $this->render('/site/lesson/view', array(
        'article' => $article,
        'lesson' => $lesson
    ));
  }
} 